package com.firefly.admin.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.firefly.admin.common.annotations.annotation.SensitiveEncrypt;
import com.firefly.admin.common.enums.SensitiveTypeEnum;
import com.firefly.admin.common.vo.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.Date;

@ApiModel(value = "FySystemUser", description = "系统管理员信息")
@Data
@ToString
@EqualsAndHashCode(callSuper = false)
public class FySystemUser extends BaseEntity {

    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "用户名")
    private String userName;

    @ApiModelProperty(value = "登录密码")
    private String loginPwd;

    @ApiModelProperty(value = "组织机构ID")
    private Long orgId;

    @ApiModelProperty(value = "数据权限范围")
    private String dataPermissionRange;

    @ApiModelProperty(value = "管理员手机号")
    @SensitiveEncrypt(type = SensitiveTypeEnum.MOBILE)
    private String mobile;

    @ApiModelProperty(value = "用户状态", notes = "0：启用 1：停用")
    private String userStatus;

    @ApiModelProperty(value = "电子邮箱")
    @SensitiveEncrypt(type = SensitiveTypeEnum.EMAIL)
    private String email;

    @ApiModelProperty(value = "真实名称")
    @SensitiveEncrypt(type = SensitiveTypeEnum.NAME)
    private String realName;

    @ApiModelProperty(value = "头像图片地址")
    private String headSculpture;

    @ApiModelProperty(value = "性别", notes = "1:男 2:女")
    private String gender;

    @ApiModelProperty(value = "生日")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "Asia/Shanghai")
    private Date birthday;

    @ApiModelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    @ApiModelProperty(value = "个人介绍")
    private String introduction;

    @ApiModelProperty(value = "组织机构信息")
    @TableField(exist = false)
    private FySystemOrganization organization;

    @ApiModelProperty(value = "登录IP")
    @TableField(exist = false)
    private String loginIp;

    @ApiModelProperty(value = "登录地址")
    @TableField(exist = false)
    private String loginAddress;
}
